package com.wang.project.remote.gatewayRemote;

import com.wang.openApiCommon.remote.InnerUserInterfaceIntoService;
import com.wang.project.service.UserInterfaceInfoService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

@Service("InnerUserInterfaceIntoService")
public class InnerUserInterfaceInfoServiceImpl implements InnerUserInterfaceIntoService {

    @Resource
    private UserInterfaceInfoService userInterfaceInfoService;

    /**
     * 调用次数加一   调用的是本地的 userInterfaceInfoService
     *
     * @param interfaceInfoId
     * @param userId
     * @return
     */
    @Override
    public Boolean invokeCount(long interfaceInfoId, long userId) {
        return userInterfaceInfoService.invokeCount(interfaceInfoId, userId);
    }

    /**
     * 获取当前用户接口剩余调用次数
     * @param interfaceInfoId
     * @param userId
     * @return
     */
    @Override
    public Integer getInvokeUserCount(long interfaceInfoId, long userId) {
        return userInterfaceInfoService.getInvokeUserCount(interfaceInfoId, userId);
    }
}
